<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>级联选择器组件演示 - 新数据结构</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            padding: 20px;
        }
        
        .container {
            max-width: 1200px;
            margin: 0 auto;
            background: white;
            padding: 32px;
            border-radius: 16px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
        }
        
        .header {
            text-align: center;
            margin-bottom: 40px;
            padding-bottom: 20px;
            border-bottom: 3px solid #f0f0f0;
        }
        
        .header h1 {
            color: #2c3e50;
            font-size: 2.5rem;
            margin-bottom: 10px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .header p {
            color: #7f8c8d;
            font-size: 1.1rem;
        }
        
        .demo-section {
            margin-bottom: 40px;
            padding: 30px;
            background: #f8f9fa;
            border-radius: 12px;
            border-left: 5px solid #667eea;
        }
        
        .demo-section h2 {
            color: #2c3e50;
            font-size: 1.5rem;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .form-group {
            margin-bottom: 24px;
        }
        
        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
            color: #34495e;
            font-size: 14px;
        }
        
        .result-box {
            margin-top: 20px;
            padding: 20px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
        }
        
        .result-box h4 {
            margin-bottom: 12px;
            font-size: 1.1rem;
        }
        
        .result-box p {
            margin: 8px 0;
            font-size: 14px;
            line-height: 1.6;
        }
        
        .result-box strong {
            color: #ffeaa7;
        }
        
        .preset-buttons {
            margin-top: 20px;
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
        }
        
        .preset-buttons button {
            padding: 10px 20px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            transition: all 0.3s ease;
            box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
        }
        
        .preset-buttons button:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
        }
        
        .preset-buttons button:active {
            transform: translateY(0);
        }
        
        .features {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }
        
        .feature-card {
            padding: 20px;
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            text-align: center;
        }
        
        .feature-icon {
            font-size: 2rem;
            margin-bottom: 10px;
        }

        /* 级联选择器样式 */
        .cascader-select {
            position: relative;
            width: 100%;
        }
        
        .input-wrapper {
            position: relative;
            cursor: pointer;
        }
        
        .cascader-input {
            width: 100%;
            padding: 12px 40px 12px 16px;
            border: 2px solid #e9ecef;
            border-radius: 8px;
            background-color: #fff;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 14px;
            line-height: 1.5;
            box-sizing: border-box;
        }
        
        .cascader-input:hover {
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }
        
        .cascader-input:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
        }
        
        .arrow-icon {
            position: absolute;
            right: 16px;
            top: 50%;
            transform: translateY(-50%);
            color: #adb5bd;
            font-size: 12px;
            transition: transform 0.3s ease;
            pointer-events: none;
        }
        
        .arrow-icon.arrow-up {
            transform: translateY(-50%) rotate(180deg);
        }
        
        .cascader-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: white;
            border: 2px solid #e9ecef;
            border-radius: 12px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
            z-index: 2000;
            margin-top: 8px;
            max-height: 450px;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        
        .cascader-content {
            flex: 1;
            overflow: hidden;
        }
        
        .cascader-header {
            display: flex;
            border-bottom: 2px solid #e9ecef;
            background: #fff;
        }
        
        .cascader-header-item {
            flex: 1;
            min-width: 100px;
            width: 100px;
            padding: 8px 12px;
            font-weight: 600;
            font-size: 13px;
            color: #667eea;
            text-align: left;
            border-right: 1px solid #dee2e6;
            background: #fff;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
        }
        
        .cascader-header-item:last-child {
            border-right: none;
        }
        
        .cascader-panels {
            display: flex;
            max-height: 350px;
            overflow: auto;
        }
        
        .cascader-panel {
            flex: 1;
            min-width: 100px;
            width: 100px;
            border-right: 1px solid #e9ecef;
            background: #fff;
        }
        
        .cascader-panel:last-child {
            border-right: none;
        }
        
        .cascader-option {
            padding: 8px 12px;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 13px;
            color: #495057;
            transition: all 0.2s ease;
            position: relative;
        }
        
        .cascader-option:hover {
            background-color: #f8f9fa;
            color: #667eea;
        }
        
        .cascader-option.is-active {
            color: #667eea;
            background-color: #e7f3ff;
            font-weight: 500;
        }
        
        .cascader-option.is-selected {
            color: #667eea;
            font-weight: 600;
        }
        
        .cascader-option.has-children {
            padding-right: 40px;
        }
        
        .option-label {
            flex: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .option-arrow {
            color: #adb5bd;
            font-size: 12px;
            margin-left: 8px;
            font-weight: bold;
        }
        
        .cascader-footer {
            border-top: 1px solid #e9ecef;
            padding: 16px 20px;
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            background: #fff;
        }
        
        .btn {
            padding: 8px 20px;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            border: 2px solid;
            transition: all 0.3s ease;
        }
        
        .btn-cancel {
            background: #fff;
            color: #6c757d;
            border-color: #dee2e6;
        }
        
        .btn-cancel:hover {
            color: #495057;
            border-color: #adb5bd;
            background-color: #f8f9fa;
        }
        
        .btn-confirm {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: #fff;
            border-color: transparent;
        }
        
        .btn-confirm:hover:not(:disabled) {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
        }
        
        .btn-confirm:disabled {
            background: #adb5bd;
            border-color: #adb5bd;
            cursor: not-allowed;
            transform: none;
        }
        
        @media (max-width: 768px) {
            .container {
                padding: 20px;
            }
            
            .cascader-panel {
                min-width: 100px;
                width: 100px;
            }
            
            .cascader-header-item {
                min-width: 100px;
                width: 100px;
                font-size: 12px;
                padding: 6px 8px;
            }
            
            .cascader-option {
                padding: 6px 8px;
                font-size: 12px;
            }
            
            .preset-buttons {
                justify-content: center;
            }
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="container">
            <div class="header">
                <h1>🚀 级联选择器组件 (新数据结构)</h1>
                <p>Vue3 + TypeScript 实现的高性能级联选择器 - name/nameCn/nameEn</p>
            </div>
            
            <div class="demo-section">
                <h2>📊 新数据结构说明</h2>
                <div class="features">
                    <div class="feature-card">
                        <div class="feature-icon">🔑</div>
                        <h4>name 字段</h4>
                        <p>唯一标识符，用于内部逻辑处理</p>
                    </div>
                    <div class="feature-card">
                        <div class="feature-icon">🇨🇳</div>
                        <h4>nameCn 字段</h4>
                        <p>中文显示名称，用于界面展示</p>
                    </div>
                    <div class="feature-card">
                        <div class="feature-icon">🇺🇸</div>
                        <h4>nameEn 字段</h4>
                        <p>英文显示名称，支持多语言</p>
                    </div>
                    <div class="feature-card">
                        <div class="feature-icon">✨</div>
                        <h4>向后兼容</h4>
                        <p>可以通过工具函数转换旧格式</p>
                    </div>
                </div>
            </div>

            <div class="demo-section">
                <h2>🔧 基础演示</h2>
                <div class="form-group">
                    <label>选择组件分类：</label>
                    <cascader-select
                        :model-value="selectedValue1"
                        :options="options"
                        placeholder="请选择分类"
                        @update:model-value="updateValue1"
                        @change="handleChange1"
                        style="max-width: 500px;"
                    ></cascader-select>
                </div>
                
                <div class="result-box" v-if="selectedValue1.length">
                    <h4>📊 选中结果</h4>
                    <p><strong>name路径：</strong> {{ selectedValue1.join(' → ') }}</p>
                    <p><strong>中文路径：</strong> {{ selectedLabels1.join(' → ') }}</p>
                    <p><strong>英文路径：</strong> {{ selectedLabelsEn1.join(' → ') }}</p>
                    <p><strong>输入框显示：</strong> "{{ selectedLabels1[selectedLabels1.length - 1] || '' }}"</p>
                    <p><strong>选择层级：</strong> 第 {{ selectedValue1.length }} 级</p>
                </div>
            </div>

            <div class="demo-section">
                <h2>🎮 预设值演示</h2>
                <div class="form-group">
                    <label>快速设置预设值：</label>
                    <cascader-select
                        :model-value="selectedValue2"
                        :options="options"
                        placeholder="请选择分类"
                        @update:model-value="updateValue2"
                        @change="handleChange2"
                        style="max-width: 500px;"
                    ></cascader-select>
                </div>
                
                <div class="preset-buttons">
                    <button @click="setPreset('component', 'basic', 'button')">🔘 设置为 按钮</button>
                    <button @click="setPreset('component', 'form', 'input')">📝 设置为 输入框</button>
                    <button @click="setPreset('guide', 'disciplines')">📚 设置为 设计原则</button>
                    <button @click="setPreset('resource')">📦 设置为 资源</button>
                    <button @click="setPreset('component', 'data', 'table')">📊 设置为 表格</button>
                    <button @click="clearSelection">🗑️ 清空选择</button>
                </div>
                
                <div class="result-box" v-if="selectedValue2.length">
                    <h4>📊 当前选中</h4>
                    <p><strong>name路径：</strong> {{ selectedValue2.join(' → ') }}</p>
                    <p><strong>中文显示：</strong> {{ selectedLabels2.join(' → ') }}</p>
                    <p><strong>英文显示：</strong> {{ selectedLabelsEn2.join(' → ') }}</p>
                    <p><strong>选择深度：</strong> {{ selectedValue2.length }} 级</p>
                    <p><strong>可继续展开：</strong> {{ hasChildren(selectedValue2) ? '是' : '否' }}</p>
                </div>
            </div>

            <div class="demo-section">
                <h2>📋 数据结构对比</h2>
                <div style="background: white; padding: 20px; border-radius: 8px;">
                    <h3>旧数据结构 (v1.x)：</h3>
                    <pre style="background: #f6f8fa; padding: 16px; border-radius: 4px; overflow-x: auto; margin: 10px 0;"><code>{
  value: 'component',
  label: 'Component',
  children: [...]
}</code></pre>
                    
                    <h3>新数据结构 (v2.x)：</h3>
                    <pre style="background: #f6f8fa; padding: 16px; border-radius: 4px; overflow-x: auto; margin: 10px 0;"><code>{
  name: 'component',        // 唯一标识
  nameCn: '组件',          // 中文显示
  nameEn: 'Component',     // 英文显示
  children: [...]
}</code></pre>

                    <h3>优势对比：</h3>
                    <ul style="margin: 15px 0; padding-left: 20px; color: #495057;">
                        <li>✅ <strong>多语言支持</strong>：同时支持中英文显示</li>
                        <li>✅ <strong>语义化字段</strong>：name/nameCn/nameEn 字段含义更清晰</li>
                        <li>✅ <strong>更好的搜索</strong>：可以按中文或英文搜索</li>
                        <li>✅ <strong>国际化友好</strong>：方便后续扩展其他语言</li>
                        <li>✅ <strong>类型安全</strong>：TypeScript 完美支持</li>
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <script>
        const { createApp, ref, computed } = Vue

        // 级联选择器组件（新数据结构版本）
        const CascaderSelect = {
            props: {
                options: {
                    type: Array,
                    required: true
                },
                modelValue: {
                    type: Array,
                    default: () => []
                },
                placeholder: {
                    type: String,
                    default: '请选择'
                }
            },
            emits: ['update:modelValue', 'change'],
            setup(props, { emit }) {
                const showDropdown = ref(false)
                const tempSelectedPath = ref([...props.modelValue])
                
                const cascaderPanels = computed(() => {
                    const panels = [props.options]
                    
                    let currentOptions = props.options
                    for (let i = 0; i < tempSelectedPath.value.length; i++) {
                        const selectedValue = tempSelectedPath.value[i]
                        const selectedOption = currentOptions.find(option => option.name === selectedValue)
                        
                        if (selectedOption && selectedOption.children) {
                            panels.push(selectedOption.children)
                            currentOptions = selectedOption.children
                        } else {
                            break
                        }
                    }
                    
                    return panels
                })
                
                const displayValue = computed(() => {
                    if (!props.modelValue.length) return ''
                    
                    let currentOptions = props.options
                    let finalLabel = ''
                    
                    for (const value of props.modelValue) {
                        const option = currentOptions.find(opt => opt.name === value)
                        if (option) {
                            finalLabel = option.nameCn
                            currentOptions = option.children || []
                        }
                    }
                    
                    return finalLabel
                })
                
                const toggleDropdown = () => {
                    showDropdown.value = !showDropdown.value
                    if (showDropdown.value) {
                        tempSelectedPath.value = [...props.modelValue]
                    }
                }
                
                const isOptionActive = (option, level) => {
                    return tempSelectedPath.value[level] === option.name
                }
                
                const handleOptionClick = (option, level) => {
                    const newPath = tempSelectedPath.value.slice(0, level)
                    newPath.push(option.name)
                    tempSelectedPath.value = newPath
                }
                
                const handleConfirm = () => {
                    const selectedOptions = []
                    let currentOptions = props.options
                    
                    for (const value of tempSelectedPath.value) {
                        const option = currentOptions.find(opt => opt.name === value)
                        if (option) {
                            selectedOptions.push(option)
                            currentOptions = option.children || []
                        }
                    }
                    
                    emit('update:modelValue', [...tempSelectedPath.value])
                    emit('change', [...tempSelectedPath.value], selectedOptions)
                    
                    showDropdown.value = false
                }
                
                const handleCancel = () => {
                    tempSelectedPath.value = [...props.modelValue]
                    showDropdown.value = false
                }
                
                const getHeaderLabel = (level) => {
                    const labels = ['分类', '子分类', '组件', '详细', '子项']
                    return labels[level] || `级别 ${level + 1}`
                }
                
                return {
                    showDropdown,
                    tempSelectedPath,
                    cascaderPanels,
                    displayValue,
                    toggleDropdown,
                    isOptionActive,
                    handleOptionClick,
                    handleConfirm,
                    handleCancel,
                    getHeaderLabel
                }
            },
            template: `
                <div class="cascader-select">
                    <div class="input-wrapper" @click="toggleDropdown">
                        <input
                            :value="displayValue"
                            :placeholder="placeholder"
                            readonly
                            class="cascader-input"
                        />
                        <span 
                            class="arrow-icon"
                            :class="{ 'arrow-up': showDropdown }"
                        >
                            ▼
                        </span>
                    </div>

                    <div 
                        v-show="showDropdown" 
                        class="cascader-dropdown"
                    >
                        <div class="cascader-content">
                            <div class="cascader-header">
                                <div 
                                    v-for="(panel, level) in cascaderPanels"
                                    :key="'header-' + level"
                                    class="cascader-header-item"
                                >
                                    {{ getHeaderLabel(level) }}
                                </div>
                            </div>
                            <div class="cascader-panels">
                                <div
                                    v-for="(panel, level) in cascaderPanels"
                                    :key="level"
                                    class="cascader-panel"
                                >
                                    <div
                                        v-for="option in panel"
                                        :key="option.name"
                                        class="cascader-option"
                                        :class="{
                                            'is-active': isOptionActive(option, level),
                                            'has-children': option.children && option.children.length > 0
                                        }"
                                        @click="handleOptionClick(option, level)"
                                    >
                                        <span class="option-label">{{ option.nameCn }}</span>
                                        <span 
                                            v-if="option.children && option.children.length > 0"
                                            class="option-arrow"
                                        >
                                            ＞
                                        </span>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="cascader-footer">
                            <button 
                                class="btn btn-cancel"
                                @click="handleCancel"
                            >
                                取消
                            </button>
                            <button 
                                class="btn btn-confirm"
                                @click="handleConfirm"
                                :disabled="!tempSelectedPath.length"
                            >
                                确定
                            </button>
                        </div>
                    </div>
                </div>
            `
        }

        createApp({
            components: {
                CascaderSelect
            },
            setup() {
                // 使用新的数据结构
                const options = [
                    {
                        name: 'guide',
                        nameCn: '指南',
                        nameEn: 'Guide',
                        children: [
                            {
                                name: 'disciplines',
                                nameCn: '设计原则',
                                nameEn: 'Disciplines',
                                children: [
                                    { name: 'consistency', nameCn: '一致性', nameEn: 'Consistency' },
                                    { name: 'feedback', nameCn: '反馈', nameEn: 'Feedback' },
                                    { name: 'efficiency', nameCn: '效率', nameEn: 'Efficiency' },
                                    { name: 'controllability', nameCn: '可控性', nameEn: 'Controllability' }
                                ]
                            },
                            {
                                name: 'navigation',
                                nameCn: '导航',
                                nameEn: 'Navigation',
                                children: [
                                    { name: 'side-nav', nameCn: '侧边导航', nameEn: 'Side Navigation' },
                                    { name: 'top-nav', nameCn: '顶部导航', nameEn: 'Top Navigation' }
                                ]
                            }
                        ]
                    },
                    {
                        name: 'component',
                        nameCn: '组件',
                        nameEn: 'Component',
                        children: [
                            {
                                name: 'basic',
                                nameCn: '基础组件',
                                nameEn: 'Basic',
                                children: [
                                    { name: 'layout', nameCn: '布局', nameEn: 'Layout' },
                                    { name: 'color', nameCn: '颜色', nameEn: 'Color' },
                                    { name: 'typography', nameCn: '字体', nameEn: 'Typography' },
                                    { name: 'icon', nameCn: '图标', nameEn: 'Icon' },
                                    { name: 'button', nameCn: '按钮', nameEn: 'Button' }
                                ]
                            },
                            {
                                name: 'form',
                                nameCn: '表单组件',
                                nameEn: 'Form',
                                children: [
                                    { name: 'radio', nameCn: '单选框', nameEn: 'Radio' },
                                    { name: 'checkbox', nameCn: '复选框', nameEn: 'Checkbox' },
                                    { name: 'input', nameCn: '输入框', nameEn: 'Input' },
                                    { name: 'input-number', nameCn: '数字输入框', nameEn: 'InputNumber' },
                                    { name: 'select', nameCn: '选择器', nameEn: 'Select' },
                                    { name: 'cascader', nameCn: '级联选择器', nameEn: 'Cascader' },
                                    { name: 'switch', nameCn: '开关', nameEn: 'Switch' },
                                    { name: 'slider', nameCn: '滑块', nameEn: 'Slider' }
                                ]
                            },
                            {
                                name: 'data',
                                nameCn: '数据展示',
                                nameEn: 'Data',
                                children: [
                                    { name: 'table', nameCn: '表格', nameEn: 'Table' },
                                    { name: 'tag', nameCn: '标签', nameEn: 'Tag' },
                                    { name: 'progress', nameCn: '进度条', nameEn: 'Progress' },
                                    { name: 'tree', nameCn: '树形控件', nameEn: 'Tree' },
                                    { name: 'pagination', nameCn: '分页', nameEn: 'Pagination' },
                                    { name: 'badge', nameCn: '徽章', nameEn: 'Badge' }
                                ]
                            }
                        ]
                    },
                    {
                        name: 'resource',
                        nameCn: '资源',
                        nameEn: 'Resource',
                        children: [
                            { name: 'axure', nameCn: 'Axure 组件', nameEn: 'Axure Components' },
                            { name: 'sketch', nameCn: 'Sketch 模板', nameEn: 'Sketch Templates' },
                            { name: 'docs', nameCn: '设计文档', nameEn: 'Design Documentation' }
                        ]
                    }
                ]

                // 响应式数据
                const selectedValue1 = ref([])
                const selectedLabels1 = ref([])
                const selectedLabelsEn1 = ref([])
                const selectedValue2 = ref(['component', 'basic', 'button'])
                const selectedLabels2 = ref(['组件', '基础组件', '按钮'])
                const selectedLabelsEn2 = ref(['Component', 'Basic', 'Button'])

                // 方法
                const updateValue1 = (value) => {
                    selectedValue1.value = value
                }

                const updateValue2 = (value) => {
                    selectedValue2.value = value
                }

                const handleChange1 = (value, optionList) => {
                    selectedLabels1.value = optionList.map(opt => opt.nameCn)
                    selectedLabelsEn1.value = optionList.map(opt => opt.nameEn)
                    console.log('选择1变更:', value, optionList)
                }

                const handleChange2 = (value, optionList) => {
                    selectedLabels2.value = optionList.map(opt => opt.nameCn)
                    selectedLabelsEn2.value = optionList.map(opt => opt.nameEn)
                    console.log('选择2变更:', value, optionList)
                }

                const setPreset = (...values) => {
                    selectedValue2.value = values
                    // 计算对应的标签
                    let currentOptions = options
                    const labelsCn = []
                    const labelsEn = []
                    for (const value of values) {
                        const option = currentOptions.find(opt => opt.name === value)
                        if (option) {
                            labelsCn.push(option.nameCn)
                            labelsEn.push(option.nameEn)
                            currentOptions = option.children || []
                        }
                    }
                    selectedLabels2.value = labelsCn
                    selectedLabelsEn2.value = labelsEn
                }

                const clearSelection = () => {
                    selectedValue2.value = []
                    selectedLabels2.value = []
                    selectedLabelsEn2.value = []
                }

                const hasChildren = (valuePath) => {
                    let currentOptions = options
                    for (const value of valuePath) {
                        const option = currentOptions.find(opt => opt.name === value)
                        if (option) {
                            if (option.children && option.children.length > 0) {
                                currentOptions = option.children
                            } else {
                                return false
                            }
                        } else {
                            return false
                        }
                    }
                    return currentOptions.length > 0
                }

                return {
                    options,
                    selectedValue1,
                    selectedLabels1,
                    selectedLabelsEn1,
                    selectedValue2,
                    selectedLabels2,
                    selectedLabelsEn2,
                    updateValue1,
                    updateValue2,
                    handleChange1,
                    handleChange2,
                    setPreset,
                    clearSelection,
                    hasChildren
                }
            }
        }).mount('#app')
    </script>
</body>
</html>
